<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>اضافة فاتورة</title>


<!---------------------for autocomplete--------------->
	<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-1.11.0.min.js');?>" ></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-ui-1.10.4/js/jquery-ui-1.10.4.min.js');?>" ></script>
	<link href="<?php echo base_url("assets/css/jquery-ui.css")?>" rel="stylesheet" type="text/css" />
<!---------------------for form css ----------------------->
	<link href="<?php echo base_url("assets/css/pure.css")?>" rel="stylesheet" type="text/css" />
<!---------------------for form validation ----------------------->
<script type="text/javascript" src="<?php echo base_url('assets/js/jquery.validate.js');?>" ></script>
<!---------------------for form mask input ----------------------->
<script type="text/javascript" src="<?php echo base_url('assets/js/jquery.mask.min.js');?>" ></script>


</head>
<body>
<?php
include_once('header.php');

$r3=$liste_article['rec']; // list of all activities for auto complete

$liste_des_articles = array();
foreach ($r3 as $lda){
	array_push($liste_des_articles, $lda->nom_art);
	
}

?>
<?php
echo form_open_multipart( base_url('facture_ctr/valider_ajout_facture_direct/').'/'.$id_fourn.'/'.$numero_fact.'/'.$nature ); 
?>

<form id="fournisseur_frm" class="pure-form pure-form-stacked" method="POST" action="<?php echo base_url('facture_ctr/valider_ajout_facture')?>">
    <fieldset>
        <legend>اضافة فاتورة:</legend>

        <div class="pure-g">
            <div class="pure-u-1 pure-u-md-1-3">
                <label for="fournisseur">المبلغ </label>
				 <input id="numero_fact" name="montant" type="text" value="">

            </div>
			
			  <div class="pure-u-1 pure-u-md-1-3">
                <label for="fournisseur">المادة </label>
				 <input id="article" name="article" type="text" value="">

            </div>

          	<div class="pure-u-1 pure-u-md-1-3">
                <label for="rc"> الصورة  </label>
				
				<input type="file"  name="userfile" size="20" />
            </div>

           
			
        </div>
<?php
  $goupe=$this->session->userdata('user_group'); //access it
if($goupe=="admin"){
echo ('<input type="submit" class="pure-button pure-button-primary" value="اضافة">
<a href="'. base_url('facture_ctr/index_test').'" class="pure-button pure-button-primary">خروج</a>');
}else{
	echo ('<a href="#" class="pure-button-disabled pure-button-primary">تحديث</a>
	<a href="'. base_url('facture_ctr/index_test').'" class="pure-button pure-button-primary">خروج</a>');
}
?>

     <!-- <input type="submit" value="Envoyer"  class="pure-button pure-button-primary" />-->

    
    </fieldset>
</form>


	
</body>
<script>
	$(function() {
	

var liste_article = <?php echo json_encode($liste_des_articles); ?>;

$( "#article" ).autocomplete({source: liste_article});


});
</script>